import request from '@/utils/request'

//通过采购单id查询要入库的数据
export function getSelectByOrdersIdList(query) {
    return request({
        url: '/depot/orders/selectByOrdersIdList',
        method: 'get',
        params: query
    })
}
//通过采购单id查询要入库的数据
export function getSelectByOrderIdList(query) {
    return request({
        url: '/depot/orders/selectByOrderIdList',
        method: 'get',
        params: query
    })
}

//通过产品id查询要入库的数据
export function getSelectByProductIdList(query) {
    return request({
        url: '/depot/orders/selectByProductIdList',
        method: 'get',
        params: query
    })
}

//取消入库
export function getCancelPutAway(data) {
    return request({
        url: '/depot/orders/cancelPutAway',
        method: 'put',
        data: data
    })
}

//确定入库
export function getAddInboundProducts(data) {
    return request({
        url: '/depot/orders/addInboundProducts',
        method: 'post',
        data: data
    })
}

//通过产品明细id查询数据
export function getSelectByIds(ids) {
    return request({
        url: '/depot/orders/selectByIds/' + ids,
        method: 'get',
    })

}

//取消
export function getUpdateDetailsStatus(data) {
    return request({
        url: '/depot/orders/updateDetailsStatus',
        method: 'put',
        data: data
    })
}

//查询产品明细表的和修改明细表是否有对应的数据
export function getSelectListProductId(ordersId) {
    return request({
        url: '/depot/orders/selectListProductId/' + ordersId,
        method: 'get'
    })
}

export function getUpdateProductIdDetailsStatus(id) {
    return request({
        url: '/depot/orders/updateProductIdDetailsStatus/' + id,
        method: 'put',
    })
}

//修改的时候取消需要判断是否选择的状态
export function getUpdateTestDetailsStatus(flay, ordersId, productId) {
    return request({
        url: '/depot/orders/updateTestDetailsStatus/' + flay + "/" + ordersId + "/" + productId,
        method: 'put',
    })
}

